package cn.huiyunche.base.service.enums;

/**
 * @ClassName: BWeightEnum
 * @Description: 权重表类别
 * @author: Aaron
 * @date: 2016年9月22日 下午4:30:07
 */
public enum BWeightEnum {

    ORIGIN(10, "始发地"),
    DESTINATION(20, "目的地"),;

    private final int value;
    private final String text;

    BWeightEnum(int value, String text) {
        this.value = value;
        this.text = text;
    }

    public int getValue() {
        return value;
    }

    public String getText() {
        return text;
    }

    public static BWeightEnum getByValue(int value) {
        for (BWeightEnum temp : BWeightEnum.values()) {
            if (temp.getValue() == value) {
                return temp;
            }
        }
        return null;
    }
}
